//
//  VKJiFenShopDetailCell.m
//  V-Learn
//
//  Created by liubo on 2019/1/9.
//  Copyright © 2019 yxk. All rights reserved.
//

#import "VKJiFenShopDetailCell.h"

@implementation VKJiFenShopDetailCell{
    UILabel *_infoLabel;
}

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    VKJiFenShopDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:@"VKJiFenShopDetailCell"];
    if (cell == nil) {
        cell = [[VKJiFenShopDetailCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"VKJiFenShopDetailCell"];
    }
    tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    return cell;
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // 点击cell的时候不要变色
        self.selectionStyle = UITableViewCellSelectionStyleNone;
//        self.backgroundColor = [UIColor cz_colorWithRed:244 green:244 blue:244];
        self.backgroundColor = [UIColor whiteColor];
        
        // 布局子控件
        [self autoLayout];
    }
    return self;
}

-(void)setModel:(VKJiFenShopModel *)model{
    _model = model;
    _infoLabel.text = model.goodsInfo;
}

- (void)autoLayout{
//    // 底部视图
//    UIView *rightView = [[UIView alloc] init];
//    rightView.backgroundColor = [UIColor whiteColor];
//    rightView.layer.masksToBounds = YES;
//    rightView.layer.cornerRadius = 4;
//    [self.contentView addSubview:rightView];
//    [rightView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(@10);
//        make.left.equalTo(@(18+25));
//        make.height.equalTo(@150);
//        make.right.equalTo(@(-10));
//    }];
//
//    // icon
//    UIImageView *iconView = [[UIImageView alloc] init];
//    [self.contentView addSubview:iconView];
//    iconView.image = [UIImage imageNamed:@"order_msg"];
//    [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.width.height.equalTo(@25);
//        make.left.mas_equalTo(@10);
//        make.centerY.equalTo(rightView);
//    }];
    

    UILabel *infLabel = [[UILabel alloc] init];
    [self.contentView addSubview:infLabel];
    infLabel.font = [UIFont systemFontOfSize:16];
    _infoLabel = infLabel;
    [infLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@10);
        make.left.mas_equalTo(@15);
        make.right.equalTo(@(-15));
        make.bottom.mas_equalTo(self.mas_bottom).offset(-10);
    }];

    
}
@end
